package com.lc.cehui.ui.fragment;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.lc.cehui.R;
import com.lc.cehui.app.AppFragment;
import com.lc.cehui.ui.activity.mine.CollectionActivity;
import com.scwang.smart.refresh.header.MaterialHeader;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class ResumeReceivedFragment extends AppFragment<CollectionActivity> {
    private static final String ARG_PARAM1 = "param1";
    @BindView(R.id.addr_recycle)
    RecyclerView addrRecycle;
    @BindView(R.id.refreshLayout)
    SmartRefreshLayout refreshLayout;
    private String system_id;
    private List<String> dataList = new ArrayList<>();

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_resume_received;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    public static ResumeReceivedFragment newInstance(String system_id) {
        ResumeReceivedFragment fragment = new ResumeReceivedFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, system_id);

        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            system_id = getArguments().getString(ARG_PARAM1);

        }
    }

    @Override
    public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        for (int i = 0; i < 10; i++) {
            dataList.add(i + "");
        }
        addrRecycle.setLayoutManager(new LinearLayoutManager(getContext()));
        BaseQuickAdapter mingqibottomadpter = new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_resume_received, dataList) {
            @Override
            protected void convert(@NotNull BaseViewHolder baseViewHolder, String bean) {

            }
        };
        addrRecycle.setAdapter(mingqibottomadpter);
        refreshLayout.setRefreshHeader(new MaterialHeader(getContext()));
        refreshLayout.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh( RefreshLayout refreshLayout) {

            }
        });
    }


}
